using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FiltronASP.Models;
using System.Web.Mvc;

namespace FiltronASP.Areas.Admin.ViewModels
{
    /// <summary>
    /// Klasa bazowa dla modelu przekazywanego do widokow.
    /// </summary>
    public class BaseViewModel
    {
        /// <summary>
        /// id wersji jezykowej (w drop downie)
        /// </summary>
        public int DropDownLanguageId { get; set; }

        /// <summary>
        /// lista jezykow do drop downa
        /// </summary>
        public IQueryable<Language> LanguagesToDropDown { get; set; }

        /// <summary>
        /// aktualna wersja jezykowa
        /// </summary>
        public Language CurrentLanguage { get; set; }

        /// <summary>
        /// lista grup stron do menu z lewej
        /// </summary>
        public IQueryable<PageType> PageTypesInMenu { get; set; }

        /// <summary>
        /// lista menu (z bazy danych) do menu z lewej
        /// </summary>
        public IQueryable<Menu> MenusInMenu { get; set; }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        public BaseViewModel()
        {
        }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="languagesToDropDown">lista jezykow do drop downa</param>
        /// <param name="pageTypesInMenu">lista grup stron do menu z lewej</param>
        /// <param name="menuInMenu">lista menu z lewej</param>
        public BaseViewModel(IQueryable<Language> languagesToDropDown,
            IQueryable<PageType> pageTypesInMenu, IQueryable<Menu> menusInMenu, 
            Language currentLanguage)
        {
            this.LanguagesToDropDown = languagesToDropDown;
            this.PageTypesInMenu = pageTypesInMenu;
            this.MenusInMenu = menusInMenu;
            this.CurrentLanguage = currentLanguage;
        }
    }
}
